import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/index'
import axios from './http/http'
import './utils/validate'
import moment from 'moment'
import VueLazyload from 'vue-lazyload'




import { Menu, MenuItem, Badge, Icon, Card, Dropdown, DropdownItem, Upload, Form, FormItem, Notice, Message, Input, Button, Affix, BackTop, Row, Col } from 'view-design';
import 'view-design/dist/styles/iview.css';
Vue.component('Menu', Menu);
Vue.component('MenuItem', MenuItem);
Vue.component('Badge', Badge);
Vue.component('Icon', Icon);
Vue.component('Card', Card);
Vue.component('Dropdown', Dropdown);
Vue.component('DropdownItem', DropdownItem);
Vue.component('Upload', Upload);
Vue.component('Form', Form);
Vue.component('FormItem', FormItem);
Vue.component('Notice', Notice);
Vue.component('Message', Message);
Vue.component('Input', Input);
Vue.component('Button', Button);
Vue.component('Affix', Affix);
Vue.component('BackTop', BackTop);
Vue.component('Row', Row);
Vue.component('Col', Col);

Vue.prototype.$Notice = Notice
Vue.prototype.$Message = Message

// 图片懒加载
Vue.use(VueLazyload);


moment.locale("zh-cn");
// 定义日期格式全局过滤器
Vue.filter('dateFormat', function(daraStr) {
    return moment(daraStr).format('ll')
});
// 定义相对时间全局过滤器
Vue.filter('timeAgo', function(daraStr) {
    return moment(daraStr).startOf('seconds').fromNow();
})

Vue.prototype.$axios = axios
Vue.config.productionTip = false

new Vue({
    router,
    store,
    render: h => h(App),
}).$mount('#app')